<template>
  <div class="app-container">
    <h4>信息</h4>
    <table class="table table-striped table-condenseda table-bordered" width="100%">
      <tbody>
      <tr>
        <th>编号</th>
        <td>{{userInfoList.userId}}</td>
        <th>用户名</th>
        <td>{{ userInfoList.username}}</td>
      </tr>
      <tr>
        <th width="15%">手机号</th>
        <td width="35%"><b>{{ userInfoList.phone }}</b></td>
        <th width="15%">真实姓名</th>
        <td width="35%">{{ userInfoList.realName }}</td>
      </tr>
      <tr>
        <th width="15%">性别</th>
        <td width="35%"><b>男</b></td>
        <th width="15%">生日</th>
        <td width="35%">{{ userInfoList.birthday }}</td>
      </tr>
      <tr>
        <th>状态</th>
        <td>{{ userInfoList.locked == 0 ? '正常' : '锁定中' }}</td>
        <th>地址</th>
        <td>{{ userInfoList.address }}</td>
      </tr>
      <tr>
        <th>身份类型</th>
        <td>{{ userInfoList.idType }}</td>
        <th>身份编号</th>
        <td>{{ userInfoList.idNumber }}</td>
      </tr>
      </tbody>
    </table>
    <br>

  </div>



</template>
<script>
import userInfoApi from '@/api/userInfo'
import jwtDecode from "jwt-decode";
import {getToken} from "@/utils/auth";
import {getChildrenByNameList, getUserInfo, getUserReportList, updateUserBasicApi} from "@/views2/api/myselfManager";
import popMessage from "@/utils/popMessage";
export default {
  // 定义数据
  data() {
    return {
      id: this.$route.params.id,
      listLoading:true,
      userInfoList: {}, // 用户基本信息
      reportList: [], // 打卡记录信息
      dialogFormVisibleUserBasic:false,
      formUserBasic:{},
      dialogFormVisibleAuthBasic:false,
      formAuthBasic:{},
      idTypeList:[]


    }
  },

  // 当页面加载时获取数据
  created() {
    this.fetchDataById()
  },

  methods: {
    // 根据id查询会员记录
    fetchDataById() {
      getUserInfo(jwtDecode(getToken()).userId).then(res=>{

        let data=res.data;
        this.userInfoList=data.data;
        this.userInfoList.username=jwtDecode(getToken()).username
      })
    },
  }
}
</script>
